package Generics;
class Alg<T extends Comparable> {
    public T findMax(T[] array) {
        T max = array[0];
        for (int i = 0; i < array.length; i++) {
            if(array[i].compareTo(max) > 0) {
                max = array[i];
            }
        }
        return max;
    }
}
class A implements Comparable{
    @Override
    public int compareTo(Object o) {
        return 0;
    }
}
public class ATypeMax {
    public static void main(String[] args) {
        Alg<Integer> alg = new Alg<>();
        Integer[] array = {12,2,56,99,88};
        System.out.println(alg.findMax(array));
        Alg<A> alg2 = new Alg<A>();
    }
}
